<template>
  <!-- 个人资料 -->
  <div class="personal-view youke">
    <Navs left to="/user"></Navs>
    <Main>
      <template slot="main">
        <div class="personal-group">
          <div class="personal-head">
            <div>头像</div>
            <div class="personal-head-img" @click="headClickFun">
              <div class="head-img">
                <img :src="$store.getters.info.image" alt>
              </div>
              <van-icon name="arrow"/>
            </div>
          </div>
          <div class="inputs-group">
            <van-cell
              title="昵称"
              is-link
              to="/user/edituser?edit=1"
              :value="`${$store.getters.info.cname?$store.getters.info.cname:'请填写'}`"
            ></van-cell>
          </div>
          <div class="inputs-group">
            <van-cell
              title="联系电话"
              :value="`${$store.getters.info.mobile?$store.getters.info.mobile:'无'}`"
            ></van-cell>
          </div>
          <div class="inputs-group">
            <van-cell
              title="地区"
              is-link
              to="/user/edituser?edit=3"
              :value="`${$store.getters.info.add?$store.getters.info.add:'请填写'}`"
            ></van-cell>
          </div>
          <div class="inputs-group">
            <van-cell
              title="详细地址"
              label="描述信息"
              is-link
              to="/user/edituser?edit=4"
              :value="`${$store.getters.info.remark?$store.getters.info.remark:'请填写'}`"
            ></van-cell>
          </div>
        </div>
      </template>
    </Main>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  //接收父级传递的参数
  props: [],
  //监听数据变化
  watch: {},
  data() {
    return {};
  },
  //实例初始化之前触发事件
  beforeCreate() {},
  //实例化之后触发事件
  created() {},
  //实时监控data参数数据变化
  computed: {},
  //模板组件
  components: {},
  //执行方法
  methods: {
    headClickFun() {
      this.$router.push("/user/edituser?edit=0");
    }
  },
  mounted() {
    this.$store.dispatch("addinfo");
  }
  //路由退出时候调用
  //beforeRouteLeave(to, from, next){next()}
};
</script>

<style scoped lang="less">
.inputs-group {
  .tips {
    padding: 1rem 2rem;
    color: #666666;
  }
  .btn-view {
    width: 90%;
    height: 3.125rem;
    line-height: 3.125rem;
    text-align: center;
    color: #999999;
    background: #fff;
    margin: 0 auto;
    border-radius: 4px;
  }
}
.personal-group {
  .personal-head {
    padding: 0px 1rem;
    height: 5rem;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .personal-head-img {
      display: flex;
      align-items: center;
      .head-img {
        width: 3.75rem;
        height: 3.75rem;
        border-radius: 50%;
        background: #666666;
        margin-right: 1rem;
        img {
          width: 100%;
          height: 100%;
          border-radius: 50%;
        }
      }
    }
  }
}
</style>
